<%--
  Created by IntelliJ IDEA.
  User: whb
  Date: 2024/1/24
  Time: 9:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<input type="text" id="id"/>
<button onclick="sendMessage()">发送</button>
</body>
</html>
<script>
    function sendMessage(){
        let idval =document.getElementById('id').value;
        alert('原来的' + idval);
        let encodeIdVal = encodeURI(idval);
        alert('翻译之后的'+encodeIdVal);
        location.href='2.jsp?id='+ encodeIdVal;
    }
</script>